Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #109

Closed
wants to merge 7 commits into from
Closed

test #109

wants to merge 7 commits into from

Conversation

thesamesam
Copy link
Member

No description provided.

Solaris' GCC can't understand that our use is fine, unlike modern compilers:
```
list.c: In function 'print_totals_basic':
list.c:1191:4: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
  uint64_to_str(totals.files, 0));
  ^~~~~~~~~~~~~
cc1: all warnings being treated as errors
```

It's presumably because of older gettext missing format attributes.
Inspired by RsyncProject/rsync@3f2a38b.

It runs on Solaris 5.11 via a VirtualBox VM.
Solaris' sed appears broken and chokes on the old version:
```
running build-aux/version.sh
chunk 1 (sed)
5
7
0
alpha
chunk 2 (sed + tr)
5|7|0|alpha|
chunk 3 (sed + tr + sed)
chunk 4 (sed + tr + sed + tr)
```

vs (good):
```
running build-aux/version-gsed.sh
chunk 1 (gsed)
5
7
0
alpha
chunk 2 (gsed + tr)
5|7|0|alpha|
chunk 3 (gsed + tr + gsed)
5.7.0alpha
chunk 4 (gsed + tr + gsed + tr)
5.7.0alpha
```

Rather than requiring GNU sed, rewrite in POSIX awk. Thank you to Kerin
Millar for the rewrite.

Unfortunately, we cannot rely on the xpg4 POSIX versions, because of:
"""
Only the core-os packages are guaranteed to be present on a Solaris 11
regular installation, thus only oawk/awk and nawk are there. In particular,
when you create a new non global zone, it contains by default the
solaris-small-server group package so neither the xpg4 nor the gnu awk
binaries are available.
"""

As a bonus, it's IMO far more legible now. Given Recent Events, the fewer
immediately-obvious sed expressions in the world, the better.

Thanks-to: Kerin Millar <[email protected]>
On NetBSD:
```
  In file included from common/common.h:17,
                   from common/common.c:12:
  ../../src/common/tuklib_integer.h:69: error: "bswap16" redefined [-Werror]
     69 | # define bswap16(n) __builtin_bswap16(n)
        |
  In file included from /usr/include/amd64/bswap.h:13,
                   from /usr/include/sys/endian.h:107,
                   from /usr/include/amd64/endian.h:3,
                   from /usr/include/sys/types.h:98,
                   from /usr/include/stdlib.h:41,
                   from ../../src/common/sysdefs.h:134,
                   from common/common.h:15,
                   from common/common.c:12:
  /usr/include/sys/bswap.h:71: note: this is the location of the previous definition
     71 | #define bswap16(x) \
        |
```

If we're in the case where we know we have __builtin_bswap*, just undef
_bswap* first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant